﻿using FreeSql.DataAnnotations;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ZoneLinePacking.Attributes;
using ZoneLinePacking.Models.Entity.StationResult;

namespace ZoneLinePacking.Models.StationResult.QOPStation {

    /// <summary>
    /// 上支撑螺母拧紧工位(左)
    /// </summary>
    /// <remarks>
    /// <para>StationCode：OP580-1</para>
    /// <para>IP：192.168.10.90</para>
    /// </remarks>
    [Index(nameof(QOP050LStationResult) + "index_1", nameof(AbsScanCode), IsUnique = false)]
    [Index("{tablename}_uk_code", nameof(Code), IsUnique = true)]
    public class QOP050LStationResult : QOP050StationResult {

        private string _labelScanCode;
        /// <summary>
        /// 标签纸批次码
        /// </summary>
        [DgColumnAttr("标签纸批次码")]
        public string LabelCapScanCode {
            get { return _labelScanCode; }
            set => SetProperty(ref _labelScanCode, value);
        }

        private string _dustCapScanCode;
        /// <summary>
        /// 防尘帽批次码
        /// </summary>
        [DgColumnAttr("防尘帽批次码")]
        public string DustCapScanCode {
            get { return _dustCapScanCode; }
            set => SetProperty(ref _dustCapScanCode, value);
        }

    }

    /// <summary>
    /// 上支撑螺母拧紧工位(右)
    /// </summary>
    /// <remarks>
    /// <para>StationCode：OP580-2</para>
    /// <para>IP：192.168.10.105</para>
    /// </remarks>
    [Index(nameof(QOP050RStationResult) + "index_1", nameof(AbsScanCode), IsUnique = false)]
    [Index("{tablename}_uk_code", nameof(Code), IsUnique = true)]
    public class QOP050RStationResult : QOP050StationResult {

        private string _labelScanCode;
        /// <summary>
        /// 标签纸批次码
        /// </summary>
        [DgColumnAttr("标签纸批次码")]
        public string LabelCapScanCode {
            get { return _labelScanCode; }
            set => SetProperty(ref _labelScanCode, value);
        }

        private string _dustCapScanCode;
        /// <summary>
        /// 防尘帽批次码
        /// </summary>
        [DgColumnAttr("防尘帽批次码")]
        public string DustCapScanCode {
            get { return _dustCapScanCode; }
            set => SetProperty(ref _dustCapScanCode, value);
        }

    }


    public class QOP050StationResult : StationResultBase {

        private float _tightenTorque;
        /// <summary>
        /// 拧紧力矩
        /// </summary>
        [DgColumnAttr("拧紧力矩")]
        public float TightenTorque {
            get { return _tightenTorque; }
            set { SetProperty(ref _tightenTorque, value); }
        }

        private float _tightenAngle;
        /// <summary>
        /// 拧紧角度
        /// </summary>
        [DgColumnAttr("拧紧角度")]
        public float TightenAngle {
            get { return _tightenAngle; }
            set { SetProperty(ref _tightenAngle, value); }
        }

        private float _threadLength;
        /// <summary>
        /// 螺纹长度
        /// </summary>
        [DgColumnAttr("螺纹长度")]
        public float ThreadLength {
            get { return _threadLength; }
            set => SetProperty(ref _threadLength, value);
        }

        private float _pressPosition;
        /// <summary>
        /// 压机位置
        /// </summary>
        [DgColumnAttr("压机位置")]
        public float PressPosition {
            get { return _pressPosition; }
            set => SetProperty(ref _pressPosition, value);
        }

        private float _pressForce;
        /// <summary>
        /// 压机压力
        /// </summary>
        [DgColumnAttr("压机压力")]
        public float PressForce {
            get { return _pressForce; }
            set => SetProperty(ref _pressForce, value);
        }
    }

}
